/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ajustes.db;

/**
 *
 * @author Jessica Ordoñez
 */
public class Division {

    private int id;
    private String nombre;
    private int empresaId;

    public Division(int id, String nombre, int empresaId) {
        this.id = id;
        this.nombre = nombre;
        this.empresaId = empresaId;
    }

    @Override
    public boolean equals(Object obj) {

        //por referencia (Reflexivo)
        if (this == obj) {
            return true;
        }

        //por objeto nulo (No Nulo)
        if (obj == null) {
            return false;
        }

        //
        if (!(obj instanceof Division)) {
            return false;
        }


        Division tmp = (Division) obj;
        return getId() == tmp.getId() && getEmpresaId() == tmp.getEmpresaId();

    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 83 * hash + this.id;
        hash = 83 * hash + this.empresaId;
        return hash;
    }

    @Override
    public String toString() {
        return this.nombre;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @return the nombre
     */
    public String getNombre() {
        return nombre;
    }

    /**
     * @return the empresaId
     */
    public int getEmpresaId() {
        return empresaId;
    }
}
